const http = require('http');

let serve = http.createServer((req, res) => {
    let str = '获取文件：'
    req.on('data', data => {
        str += data
    });
    req.on('end', () => {
        console.log(str);
        res.setHeader('content-type', 'text/html;charset=utf-8')
        res.end(str)
    })
})

serve.listen(1086, () => {
    console.log('服务开启成功');
})